package com.example.train.app.service.impl;

import com.example.train.app.service.EmployeeService;
import com.example.train.domain.entity.Employee;
import com.example.train.domain.repository.EmployeeRepository;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: chundong.huang@hand-china.com
 * @Date: 2023/3/25 15:38
 */
@Service
public class EmployeeServiceImpl implements EmployeeService {

    private final EmployeeRepository employeeRepository;

    public EmployeeServiceImpl(EmployeeRepository employeeRepository) {
        this.employeeRepository = employeeRepository;
    }

    @Override
    public List<Employee> list(Long id) {
        return employeeRepository.list(id);
    }

    @Override
    public int del(Long id) {
        return employeeRepository.del(id);
    }

    @Override
    public int update(Employee employee) {
        return employeeRepository.update(employee);
    }

    @Override
    public int insert(Employee employee) {
        return employeeRepository.insert(employee);
    }
}
